home *** CD-ROM | disk | FTP | other *** search
- ;******************************************
- ; Test file for the 65c02 assembler - as65c02
- ; assemble as
- ; as65c02 -nisv assmtest
- ; and compare output with assmtest.l
- ;******************************************
- ;; comment treatment
- ;******************************************
- aa = $10; ';' immediately after the '0'
- B = $20 space to comment subfield
- C = $30 tab to comment subfield
- DEFGHIjkl = $FFEE
- D =DEFGHIjkl
- ;******************************************
- ; Number formats
- ;******************************************
- start *= $4 ; location counter adjust
- .byte %0101 ; binary number
- .byte 022,@22,^o22 ; octal numbers - three forms
- .byte 22 ; decimal number
- .byte $22,$ff,$FF ; hex - upper/lower case
- .byte 'a,'b ; single ASCII characters
- ;******************************************
- ;; ASCII character string
- ;******************************************
- .byte "abcd\t\n",0 ; tab and new line escaped
- ;******************************************
- ; Operation checks
- ;******************************************
- .word aa+B ; addition
- .word aa-B ; subtraction
- .word aa*B ; multiplication
- .word B/aa ; division
- .word C%B ; modulo
- .word B!C ; exclusive OR
- .word ~C ; one's complement
- .word B&C ; logical AND
- .word aa|B ; logical OR
- .word D\ ; low byte
- .word D^ ; high byte
- .word * ; current location
- .word aa,B,C
- .word B*<aa+C> ; one level of parenthesis
- .dbyt D ; high byte-low byte word
- .word D/256,D%256
- ;******************************************
- ; Addressing Mode Check
- ;******************************************
- *=$0100
- lda =aa ; immediate addressing
- lda #aa ; immediate addressing, alternate
- lda D ; direct addessing
- LDA aa ; page zero addressing, aa < 256
- a1 = 512
- a2 = 500
- lda a1-a2 ; also page zero
- asl A ; accumulator addressing
- AsL a ; accumulator addressing also
- brk ; implied addressing
- lda (aa,X) ; indirect,X addressing
- lda (aa),Y ; indirect,Y addressing
- lda aa,X ; zero page,X addressing
- lda D,X ; absolute,X addressing
- lda D,Y ; absolute,Y addressing
- bcc *-$10 ; relative addressing
- jmp (D) ; indirect addressing
- jmp (a2,x) ; abs indexed indirect
- adc (aa) ; indirect zero page
- ldx aa,Y ; zero page,Y addressing
- ldx aa,y ; alternate index name
- .nlst
- ;******************************************
- ; opcode check
- ;******************************************
- adc =01
- and =01
- and (aa)
- asl A
- bcc *+2
- bcs *+2
- beq *+2
- bit $01
- bit $301,x
- bit $01,x
- bmi *+2
- bne *+2
- bpl *+2
- bra *+2
- brk
- bvc *+2
- bvs *+2
- clc
- cld
- cli
- clv
- cmp =01
- cmp (aa)
- cpx =01
- cpy =01
- dea
- dec $01
- dex
- dey
- eor =01
- eor (aa)
- ina
- inc $01
- inx
- iny
- jmp *+3
- jsr *+3
- lda =01
- lda (aa)
- ldx =01
- ldy =01
- lsr A
- nop
- ora =01
- ora (aa)
- pha
- php
- phx
- phy
- pla
- plp
- plx
- ply
- rol A
- ror A
- rti
- rts
- sbc =01
- sbc (aa)
- sec
- sed
- sei
- sta $01
- sta (aa)
- stx $01
- sty $01
- stz $301
- stz $301,x
- stz $01
- stz $01,x
- tax
- tay
- trb $301
- trb $01
- tsb $301
- tsb $01
- tsx
- txa
- txs
- tya
- .title some way for a listing
- .sbttl check for .ifeq
- .ifeq 0
- .byte 1,2,3,$34,@10
- .endc
- .ifne 0
- .word 1234,$4354,@7777
- .endc
- ; now check nesting
- .ifeq 0
- lda .
- .ifne 0
- m2 .asciz /help/
- .endc
- m3 nasc <more of same>
- .endc
- msb ON
- .asciz /high order bits on /
- nasc <should not be affected> 1
- msb off
- .asciz /high order bits off/
- nasc <still not affected> 0
- m31 org *+2
- m4 .word .+34
- m41 org .+2
- m5 .byte
- ; now lets try some blank lines
- .asciz /this is ok?/
-
- nasc <how about this>
-
- .byte 0,$e
-
-
- .word 2 ;how about two in a row
- .title what does the control l mean
- .sbttl perhaps is the Dec 20 way of new page, anyway ignore it
- .ifeq 1
- .sbttl Lets check to see if we skip
- .asciz /this should not assemble/
- .sbttl these lines
- .endc
- .sbttl now this is the living end
- aaaa equ aa+3
- aaa equ abc+5
- .byte 3
- abc nasc <the end>
- .byte 255
- org $100
- .asciz /1/
- jmp d
- jmp d+2
- lda cba
- lda abc-4
- .byte 3
- nasc <1>
- nasc <22> 1
- baaa = 7+d ; can you handle this
- nasc <three> 0
- d lda #4
- cba .word 2345
- bbc
- ldx d+3^
- lda cba
- lda baaa
- jmp bbc
- lda #3
- rep lda #23
- org $fe
- .ifeq <.\-$ff> ;what does the loc counter say
- nop
- .endc
- .ifeq <.\-$fe> ; loc ctr
- nop
- nop
- .endc
-